﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Text.RegularExpressions;

namespace HarveyNash.RefactoringAndCodeSmell.CodeSmell.LazyClass
{
    public static class EmailValidator
    {
        public static bool IsValidEmailAddressSyntax(string emailAddress)
        {
            Regex emailPattern = new Regex(@"^([0-9a-zA-Z](['-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w']*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$");

            Match emailAddressToValidate = emailPattern.Match(emailAddress);

            return emailAddressToValidate.Success;
        }
    }
}
